<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-45358419-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<?php
Yii::app()->clientScript
        
        ->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.bxGallery.1.1.min.js');
?>
<div class="span5">
<ul id="slides1">
    
	    <li><img class="img-polaroid" src="<?php echo (Yii::app()->baseUrl . '/uploads/' . $model->img1); ?>" title='' /></li>
	    <li><img class="img-polaroid" src="<?php echo (Yii::app()->baseUrl . '/uploads/' . $model->img2); ?>"  title=''/></li>
	
            <li><img class="img-polaroid" src="<?php echo (Yii::app()->baseUrl . '/uploads/' . $model->img3); ?>" title='' /></li>
	    <li><img class="img-polaroid" src="<?php echo (Yii::app()->baseUrl . '/uploads/' . $model->img4); ?>" title='' /></li>
	    <li><img class="img-polaroid" src="<?php echo (Yii::app()->baseUrl . '/uploads/' . $model->img5); ?>" title='' /></li>
	   
              
</ul>
</div>
<div class="span2 well">
    <a href="<?php echo $this->createUrl('site/contact',array('subject'=>$model->title.', id:'.$model->id))?>" class="btn btn-success"><i class="icon-white icon-info-sign"></i> <?php echo Yii::t("content",'Pedir info item')?></a>  

</div>
     
<div class="span7" style="height: 200px;"><?php echo $this->renderPartial('//dashboard/map', array('model'=>$model)); ?>
</div>
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		//'id',
		array(
            'label' => Yii::t('models', 'Titulo'),
            'value' => Yii::t('content',CHtml::encode($model->title),array(),'db_i18n'),
        ),
        array(
            'label' => Yii::t('models', 'Descricao'),
            'value' => Yii::t('content',CHtml::encode($model->description),array(),'db_i18n'),
        ),
		//'lat',
		//'long',
		'square_meters',
		//'country',
		//'district',
		//'local',
		//'category_id',
		//'activ',
		//'user_id',
		'date_add',
		//'date_expire',
		'amount',

	),
)); ?>
<script type="text/javascript">

    $(document).ready(function(){

            $('#slides1').bxGallery({
                maxwidth:650,
	        maxheight: 475,
	        thumbwidth: 40,
	        
	        thumbcontainer: 90,
                opacity: .5,               // opacity level of thumbnails
	       
                thumbplacement: 'bottom',  // placement of thumbnails (top, bottom, left, right)
	        thumbcontainer: '450'
	    });
            
        

    });
</script>
<script type="text/javascript">

    var geo = new GClientGeocoder();
    var map = new GMap(document.getElementById("map"));
     
    map.addControl(new GLargeMapControl3D());
    map.addControl(new GMapTypeControl());
    map.accuracy=10;
    map.centerAndZoom(new GPoint(<?php echo $model->long; ?>, <?php echo $model->lat; ?>), 5);
    var point = new GPoint(<?php echo $model->long; ?>,<?php echo $model->lat; ?> );
    map.addControl(new GOverviewMapControl(new GSize(100,100)));

    var marker = new GMarker(point,{draggable: true});
    map.addOverlay(marker);
    map.checkResize();
    
    // Recenter Map and add Coords by clicking the map
      
    function showAddress(address) {
   
        if (geo) {
            geo.getLatLng(
            address,
            function(point) {
                if (!point) {
                    alert(address + " not found");
                } else {
                    map.setCenter(point, 14);
             
                    marker.setPoint(point)
             
                    marker.openInfoWindowHtml(address);
              
                }
            }
        );
        }
    }

</script>